#include "individualdisplayform.h"
#include "nofocusdelegate.h"

#include <QPainter>
#include <QLabel>
#include <QVBoxLayout>
#include <QListWidget>
#include <QListWidgetItem>

IndividualDisplayForm::IndividualDisplayForm(QWidget *parent) :
    QWidget(parent)
{
    setObjectName("IndividualDisplay");

    QLabel *label=new QLabel(tr("IndividualDisplay"));
    label->setObjectName("IndividualDisplayLabel");
    label->setFixedHeight(20);
    m_pListWidget=new QListWidget;
    m_pListWidget->setObjectName("m_pListWidget");
    m_pListWidget->setItemDelegate(new NoFocusDelegate());
    QVBoxLayout *layout=new QVBoxLayout;
    layout->setMargin(5);
    layout->addWidget(label);
    layout->addWidget(m_pListWidget);

    setLayout(layout);

    for(int i=0;i<90;++i)
    {
        QListWidgetItem *item=new QListWidgetItem;
        item->setText("213213213");

        m_pListWidget->addItem(item);
    }
}

IndividualDisplayForm::~IndividualDisplayForm()
{
}

void IndividualDisplayForm::paintEvent(QPaintEvent *event)
{
    Q_UNUSED(event);

    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
